<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>
<sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
    select * from regra_horarios
</sql:query>
<c:choose>
    <c:when test="${!empty query.rows}">
        <select name="id_regra_horario">
           <option value="">Selecione</option>
           <c:forEach var="row" items="${query.rows}">
                <option value="${row.id_regra_horario}">${row.desc_regra_horario} (Teoria=${row.teoria_regra_horario}% <-> Prática=${row.pratica_regra_horario}%)</option>
            </c:forEach>
        </select>
    </c:when>
    <c:otherwise>
        <p style="font-size: 12pt; color: red">Nenhuma registro encontrado.</p>
    </c:otherwise>
</c:choose>